Repository navigation
Conversation
1. Latch X11 layer surfaces to their selected output. 2. Rebind Dock and notification center when screens change. 3. Select a valid remaining output when a screen is removed. Log: Keep layer-shell windows on the intended display. PMS: TASK-384487, TASK-384649 fix: 保持 layer surface 的屏幕绑定 1. 锁存 X11 layer surface 创建时指定的屏幕。 2. Dock 和通知中心换屏时显式更新屏幕绑定。 3. 屏幕移除后选择仍有效的显示器。 Log: 修复多屏布局调整后窗口错屏及 Dock 迁屏问题。 PMS: TASK-384487, TASK-384649 (cherry picked from commit 7c03f9c)
1. Restrict output latching to background surfaces to preserve desktop placement when rearranging extended screens. 2. Restore QWindow::screen() tracking for other layers to fix dock freezes and incorrect screen selection outlines. 3. Update the latched output before switching the window screen and remove redundant notification center rebinding. Influence: 1. Rearrange extended screens and verify both desktop backgrounds. 2. Switch primary screens with the dock following the primary screen or mouse. 3. Select HDMI and eDP in display settings and verify the matching outlines. 4. Verify notification center, notification bubbles and OSD after switching. fix: 修复多屏切换卡死及屏幕选中描边错位 1. 将输出锁存限定为背景层,保留扩展屏重排时的桌面背景归属。 2. 其他层恢复跟随 QWindow::screen(),修复任务栏卡死及选屏描边错屏, 无需修改控制中心等现有调用方。 3. 切换窗口屏幕前同步锁存输出,移除通知中心多余的屏幕重绑调用。 Influence: 1. 扩展模式下调整屏幕排列,确认主副屏背景正常显示。 2. 分别设置任务栏跟随主屏、跟随鼠标,切换主屏后确认无卡死。 3. 点击显示设置中的 HDMI、eDP 缩略图,确认描边对应正确屏幕。 4. 切屏后确认通知中心、通知气泡及 OSD 的位置和交互正常。 Log: 修复多屏切换导致任务栏卡死及屏幕选中描边错位,保留副屏背景重排修复。 PMS: TASK-384487, TASK-384649 (cherry picked from commit 43d6353)
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: xujin177 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's GuideAPIAdd a screen binding interface that latches an explicit output and synchronizes the underlying window screen before emitting the change signal.
Uses of the APIRoute Dock screen changes through the layer-shell binding interface so its selected output is explicitly updated.
ImplementationUse the latched output for X11 background surfaces while preserving dynamic window-screen tracking for other layers, including fallback when an output is removed.
UIKeep the notification center bound to the Dock screen using its existing dynamic screen binding without redundant rebinding logic.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="frame/layershell/x11dlayershellemulation.cpp" line_range="212" />
<code_context>
+QScreen *LayerShellEmulation::targetScreen() const
+{
+ if (m_dlayerShellWindow->layer() == DLayerShellWindow::LayerBackground
+ && m_screen && qApp->screens().contains(m_screen.data())) {
+ return m_screen.data();
+ }
</code_context>
<issue_to_address>
**Background stays on old output**
When a background window's QWindow screen changes directly, or a moved non-background window becomes a background layer, `targetScreen()` returns construction-time `m_screen`, so X11 geometry updates keep positioning the background on the old output, including through the bundled example's `Window.screen` path.
Use the current QWindow screen for background targeting when it has changed directly, rather than retaining the construction-time `m_screen`.
</issue_to_address>
### Comment 2
<location path="frame/layershell/dlayershellwindow.cpp" line_range="184" />
<code_context>
+
+QScreen *DLayerShellWindow::screen() const
+{
+ if (d->screen) {
+ return d->screen.data();
+ }
</code_context>
<issue_to_address>
**Non-background screen getter is stale**
When a non-background layer has a saved screen from `setScreen()` and its QWindow screen later changes directly, `DLayerShellWindow::screen()` returns cached `d->screen` instead of the current parent/QWindow screen, so callers see the old output.
Make `screen()` follow the current QWindow screen for non-background layers instead of returning the saved `d->screen`.
Also at `frame/layershell/dlayershellwindow.cpp:185-186`.
</issue_to_address>| QScreen *LayerShellEmulation::targetScreen() const | ||
| { | ||
| if (m_dlayerShellWindow->layer() == DLayerShellWindow::LayerBackground | ||
| && m_screen && qApp->screens().contains(m_screen.data())) { |
There was a problem hiding this comment.
🟡 Medium · Background stays on old output
When a background window's QWindow screen changes directly, or a moved non-background window becomes a background layer, targetScreen() returns construction-time m_screen, so X11 geometry updates keep positioning the background on the old output, including through the bundled example's Window.screen path.
Use the current QWindow screen for background targeting when it has changed directly, rather than retaining the construction-time m_screen.
Prompt for AI agents
In `frame/layershell/x11dlayershellemulation.cpp` at line 212:
**Background stays on old output**
When a background window's QWindow screen changes directly, or a moved non-background window becomes a background layer, `targetScreen()` returns construction-time `m_screen`, so X11 geometry updates keep positioning the background on the old output, including through the bundled example's `Window.screen` path.
Use the current QWindow screen for background targeting when it has changed directly, rather than retaining the construction-time `m_screen`.|
|
||
| QScreen *DLayerShellWindow::screen() const | ||
| { | ||
| if (d->screen) { |
There was a problem hiding this comment.
🟡 Medium · Non-background screen getter is stale
When a non-background layer has a saved screen from setScreen() and its QWindow screen later changes directly, DLayerShellWindow::screen() returns cached d->screen instead of the current parent/QWindow screen, so callers see the old output.
Make screen() follow the current QWindow screen for non-background layers instead of returning the saved d->screen.
Also at frame/layershell/dlayershellwindow.cpp:185-186.
Prompt for AI agents
In `frame/layershell/dlayershellwindow.cpp` at line 184:
**Non-background screen getter is stale**
When a non-background layer has a saved screen from `setScreen()` and its QWindow screen later changes directly, `DLayerShellWindow::screen()` returns cached `d->screen` instead of the current parent/QWindow screen, so callers see the old output.
Make `screen()` follow the current QWindow screen for non-background layers instead of returning the saved `d->screen`.
Also at `frame/layershell/dlayershellwindow.cpp:185-186`.
|
Summary by Sourcery
Preserve layer-surface screen bindings while allowing explicit screen changes and maintaining dynamic screen selection for other layers.
New Features:
Bug Fixes:
Enhancements: